import request from '@/utils/request'

/* 角色列表分页*/
export function selectRolePage(data) {
  return request({
    url: '/system/role/selectRolePage',
    method: 'post',
    data: data
  })
}

/* 角色列表*/
export function selectRoleList(data) {
  return request({
    url: '/system/role/selectRoleList',
    method: 'post',
    data: data
  })
}

/* 新增角色*/
export function saveRole(data) {
  return request({
    url: '/system/role/saveRole',
    method: 'post',
    data: data
  })
}

/* 修改角色*/
export function updateRole(data) {
  return request({
    url: '/system/role/updateRoleById',
    method: 'post',
    data: data
  })
}

/* 通过id查询角色*/
export function selectRoleById(data) {
  return request({
    url: '/system/role/' + data,
    method: 'post'
  })
}

/* 通过id查询角色拥有菜单id*/
export function selectMenuIds(data) {
  return request({
    url: '/system/role/selectMenuIds/' + data,
    method: 'post'
  })
}

/* 分配权限*/
export function updateRolePermission(data) {
  return request({
    url: '/system/role/updateRolePermission',
    method: 'post',
    data: data
  })
}

/* 删除角色*/
export function deleteRole(data) {
  return request({
    url: '/system/role/deleteRole',
    method: 'post',
    data: data
  })
}
